/**
 * Verschiedene Schleifen mit Zeichen (char) zur Übung von Schleifen
 * 
 * @author henry@freye.de
 *
 */
public class Verschieben {

	/**
	 * @param args wird nicht ausgwertet
	 * Sinnvolle Eingaben: Zeichenketten aus Buchstaben 
	 * 
	 */
	public static void main(String[] args) {
		//String -> Zeichenkette (Wörterfolge...)
		//String original = MyIO.readString("Input: ");
		String original = "Wasser";
		//Array oder Feld von Zeichen
		int anzahl = original.length();
		
		int variante = 1;
		System.out.println('a'); //Das Zeichen Char Character a  - fast das gleiche wie "a" die Zeichenkette mit dem einen Zeichen a
		System.out.println((int)'a');  //System.out.println((int)"a") würde nicht gehen!
		System.out.println(100);  //Die Zahl 100
		System.out.println((char)100);  //Das Zeichen mit dem Code 100
		
		
		System.out.println("----------------------------------------");
		System.out.println("----------------  " + variante++ +" --------------------");
		System.out.println("--------------  Input: "+original+" ----------");
		for (int stelle = 0; stelle < anzahl; stelle++){
			System.out.print(original.charAt(stelle));
		}
		
		//Das Zeichen "\n" bewirkt einen Zeilenumbruch 
		//System.out.print(1+"\n"); ist gleichwertig zu System.out.println(1);
		//Hier ist erst Zeilenwechsel, dann -...
		System.out.println("\n----------------------------------------");
		System.out.println("----------------  " + variante++ +" --------------------");
		System.out.println("--------------  Input: "+original+" ------------------");
		for (int stelle = 0; stelle < anzahl; stelle++){
			System.out.print(original.charAt(stelle)+1);
		}
		
		System.out.println("\n----------------------------------------");
		System.out.println("----------------  " + variante++ +" --------------------");
		System.out.println("--------------  Input: "+original+" ------------------");
		for (int stelle = 0; stelle < anzahl; stelle++){
			System.out.println(1+original.charAt(stelle));
		}
		
		System.out.println("\n----------------------------------------");
		System.out.println("----------------  " + ++variante +" --------------------");
		System.out.println("--------------  Input: "+original+" ------------------");
		for (int stelle = 0; stelle < anzahl; stelle++){
			System.out.print((char)1+original.charAt(stelle));
		}		

		System.out.println("\n----------------------------------------");
		System.out.println("----------------  " + variante++ +" --------------------");
		System.out.println("--------------  Input: "+original+" ------------------");
		for (int stelle = 0; stelle < anzahl; stelle++){
			System.out.print((char)(1+original.charAt(stelle)));
		}		

		System.out.println("\n----------------------------------------");
		System.out.println("----------------  " + variante++ +" --------------------");
		System.out.println("--------------  Input: "+original+" ------------------");
		for (int stelle = 0; stelle < anzahl; stelle++){
			System.out.print((char)(2+original.charAt(stelle)));
		}		
		
		System.out.println("\n----------------------------------------");
		System.out.println("----------------  " + variante++ +" --------------------");
		System.out.println("--------------  Input: "+original+" ------------------");
		for (int stelle = 0; stelle < anzahl; stelle++){
			System.out.print((char)(2*original.charAt(stelle)));
		}

		System.out.println("\n----------------------------------------");
		System.out.println("----------------  " + variante++ +" --------------------");
		System.out.println("--------------  Input: "+original+" ------------------");
		for (int stelle = 0; stelle < anzahl; stelle++){
			System.out.print((char)(original.charAt(stelle)/2));
		}		

		System.out.println("\n----------------------------------------");
		System.out.println("----------------  " + variante++ +" --------------------");
		System.out.println("--------------  Input: "+original+" ------------------");
		for (int stelle = 0; stelle < anzahl; stelle++){
			System.out.print((char)(original.charAt(stelle))/2);
		}		

		System.out.println("\n----------------------------------------");
		System.out.println("----------------  " + variante++ +" --------------------");
		System.out.println("--------------  Input: "+original+" ------------------");
		for (int stelle = 0; stelle < anzahl; stelle++){
			if (original.charAt(stelle)<'f'){
				System.out.print(original.charAt(stelle));
			}else{
				System.out.print("*");
			}
		}		

		System.out.println("\n----------------------------------------");
		System.out.println("----------------  " + variante++ +" --------------------");
		System.out.println("--------------  Input: "+original+" ------------------");
		for (int stelle = 0; stelle < anzahl; stelle++){
			if ((int)original.charAt(stelle)<97){
				System.out.print('X');
			}else{
				System.out.print("x");
			}
		}		
		
		original = "";
		System.out.println("\n----------------------------------------");
		System.out.println("----------------  " + variante++ +" --------------------");
		System.out.println("--------------  Input: "+original+" ------------------");
		for (char zeichen = 'g'; zeichen < 'z'; zeichen++){ 
			original = original+zeichen;
		}		
		System.out.print("Output: "+original);
		
		original = "->";
		System.out.println("\n----------------------------------------");
		System.out.println("----------------  " + variante++ +" --------------------");
		System.out.println("--------------  Input: "+original+" ------------------");
		for (char zeichen = 'g'; zeichen < 'g'+anzahl; zeichen++){ 
			original = original+zeichen;
		}		
		System.out.print("Output: "+original);
	
		original = "";
		System.out.println("\n----------------------------------------");
		System.out.println("----------------  " + variante++ +" --------------------");
		System.out.println("--------------  Input: "+original+" ------------------");
		for (char zeichen = 'A'; zeichen < 'z'; zeichen++){ 
			original = original+zeichen;
		}		
		System.out.print("Output: "+original);
		
		original = "";
		System.out.println("\n----------------------------------------");
		System.out.println("----------------  " + variante++ +" --------------------");
		System.out.println("--------------  Input: "+original+" ------------------");
		for (int code = 0; code < 256; code++){ 
			original = original+(char)code;
		}		
		System.out.print((int)'a');
		
		//Warum "springt" die Nummerierung?
	}//end of main
}//end of class
